Copyright: Copyright'94 Instant Replay or its Suppliers


Contents
Visual FX DLL Contents

Introduction

How to add special effects to your programs

Function Syntax

Effects

Visual Basic Information

Distributing the DLL's

Sample Program


Introduction

Visual FX has several parts to it. The first is a DLL called "VISBBFX.DLL". This is a DLL that contains all of the special visual effects. It works by changing calls to the BitBlt function with calls to the BitBltFX function. It has the same parameters and functionality but with additional parameters to specify the effects. The second part is a DLL called "VISLB1FX.DLL". This DLL contains higher level routines ShowDIBFX and ShowWMFFX to directly load from disk and display DIB's, BMP's, and WMF files using special effects. This makes it very easy to add ways of displaying images to programs with only one function call. This DLL also contains functions for easily creating movement tables. The third part is the Visual FX sample programs. These C, Pascal and Basic programs come complete with source code and everything you need to compile and test using the Visual FX DLL's.


How to add special effects to your program

The Visual Effects are added by making calls to the functions in the DLL's. You should add to the definition file in the IMPORTS section the functions you want to use:

IMPORTS

BitBltFX = VISBBFX.2

BitBltFXStatus = VISBBFX.3

BitBltFXInfo = VISBBFX.4

BitbltFXSetStyle = VISBBFX.5

BitBltFXStop = VISBBFX.6

ShowWMFFX = VISLB1FX.2

ShowDIBFX = VISLB1FX.3

MakeUnivPal256 = VISLB1FX.4

MakeNearPal = VISLB1FX.5

GetCurPal = VISLB1FX.6

DestroyCurPal = VISLB1FX.7

CreateTable = VISLB1FX.8

SetTableItem = VISLB1FX.9

DestroyTable = VISLB1FX.10

SetTableSizeItem = VISLB1FX.11

SetTableBezier = VISLB1FX.12

GetBezierCurve = VISLB1FX.13

Or you can add the libraries "VISBBFX.LIB" and "VISLB1FX.LIB" to the linker input.

"C" Files:

The function prototypes are contained in the header files "VISBBFX.H" and "VISLB1FX.H". You should include these header files into your program:

#include "visbbfx.h"

#include "vislb1fx.h"

"Pascal" Files:

If you are using Borland Pascal, there are two Unit source code files (VISBBFX.PAS and VISLB1FX.PAS) that you should put in your USES statement. These files contain the TYPES, CONSTANTS and INTERFACE information for using the Visual FX DLLs. There is a sample Pascal program (VFXPAS.PAS) that shows you how to use these units.

"Visual Basic" Files:

Visual Basic users can copy the text from VISBBFX.TXT into the "General Declarations" section of the program. This file contains all of the constants, types and procedure declarations needed.

See Also

Function Syntax


Function Syntax

Available functions in Visual FX:

BitBltFX	BitBlt an image using special effects

BitBltFXInfo	Get suggested grain sizes

BitBltFXSetStyle	Set delay method to yield or no yield

BitBltFXStatus	Get status of last BitBltFX call

BitBltFXStop	Stop the current effect

CreateTable	Create a movement table

DestroyCurPal	Delete the current ShowDIBFX palette

DestroyTable	Delete a movement table

GetBezierCurve	Visually define spline movement coordinates

GetCurPal	Get the current ShowDIBFX palette

GetRectangle	Visually define a sizing rectangle

MakeNearPal	Create a palette close or near to another palette

MakeUnivPal256	Create a universal palette

SetTableBezier	Set the coordinates in a Bezier curve table

SetTableItem	Set the coordinates in a movement table

SetTableSizeItem	Set the coordinates and sizes in a movement table

ShowDIBFX	Display a DIB or BMP file using special effects

ShowWMFFX	Display a WMF file using special effects

See Also

How to add special effects to your program


Effects

This is a listing of the constants and descriptions used for the FX parameter to the BitBltFX function. All effects range from BBFX_NORMAL to BBFX_MAX_EFFECT.

Parameter	Value	Description

BBFX_NORMAL	0	Normal Display

BBFX_TTOB	1	Top to bottom

BBFX_BTOT	2	Bottom to Top

BBFX_LTOR	3	Left to Right

BBFX_RTOL	4	Right to Left

BBFX_CLOSE	5	Close

BBFX_OPEN	6	Open

BBFX_CCLOSE	7	Curtain Close

BBFX_COPEN	8	Curtain Open

BBFX_HBLINDS	9	Horizontal Blinds

BBFX_VBLINDS	10	Vertical Blinds

BBFX_EXPLODE	11	Explode

BBFX_TTOB_SLIDE	12	Slide from Top to Bottom

BBFX_BTOT_SLIDE	13	Slide from Bottom to Top

BBFX_LTOR_SLIDE	14	Slide from Left to Right

BBFX_RTOL_SLIDE	15	Slide from Right To Left

BBFX_TTOB_BLOCKS	16	Blocks from Top To Bottom

BBFX_BTOT_BLOCKS	17	Blocks from Bottom To Top

BBFX_LTOR_BLOCKS	18	Blocks from Left To Right

BBFX_RTOL_BLOCKS	19	Blocks from Right To Left

BBFX_TTOB_PUSH	20	Slide from Top To Bottom and Push Screen Contents

BBFX_BTOT_PUSH	21	Slide from Bottom to Top and Push Screen Contents

BBFX_LTOR_PUSH	22	Slide from Left to Right and Push Screen Contents

BBFX_RTOL_PUSH	23	Slide from Right to Left and Push Screen Contents

BBFX_TTOB_STACK	24	Sliding Blocks stacking from Top to Bottom

BBFX_BTOT_STACK	25	Sliding Blocks stacking from Bottom to Top

BBFX_LTOR_STACK	26	Sliding Blocks stacking from Left to Right

BBFX_RTOL_STACK	27	Sliding Blocks stacking from Right to Left

BBFX_SDIAMONDS	28	Small diamonds

BBFX_SHLINES	29	Small horizontal lines

BBFX_STRI	30	Small triangles

BBFX_SHATCH	31	Small hatch

BBFX_SX	32	Small X

BBFX_SSMILES	33	Small smiles

BBFX_CIRCLES_RANDOM	34	Random circles

BBFX_POLY_RANDOM	35	Random polygons

BBFX_RECT_RANDOM	36	Random rectangles

BBFX_CIRCLES_PAT	37	Pattern circles

BBFX_DIAMONDS_PAT	38	Pattern diamonds

BBFX_PIXELFADE	39	Pixel Fade

BBFX_TTOB_WAVE	40	Wave from Top to Bottom

BBFX_BTOT_WAVE	41	Wave from Bottom to Top

BBFX_LTOR_WAVE	42	Wave from Left to Right

BBFX_RTOL_WAVE	43	Wave from Right to Left

BBFX_CLOCK	44	Clock

BBFX_SPIRAL	45	Spiral out

BBFX_PUZZLE	46	Puzzle

BBFX_CIRCUITBOARD	47	Circuit Board

BBFX_UD_SKIPS	48	Skips lines up/down

BBFX_RL_SKIPS	49	Skips lines right/left

BBFX_MOSAIC	50	Mosaic

BBFX_MOSAIC_CAN	51	Mosaic using canvas

BBFX_IMPLODE_MOSAIC	52	Implode Mosaic

BBFX_IMPLODE_MOSAIC_CAN	53	Implode Mosaic using canvas

BBFX_TTOB_MOSAIC	54	Top to Bottom Mosaic

BBFX_BTOT_MOSAIC	55	Bottom to Top Mosaic

BBFX_LTOR_MOSAIC	56	Left to Right Mosaic

BBFX_RTOL_MOSAIC	57	Right to Left Mosaic

BBFX_EXPLODE_STRETCH	58	Stretch Explode

BBFX_TTOB_STRETCH	59	Stretch Top To Bottom

BBFX_BTOT_STRETCH	60	Stretch Bottom To Top

BBFX_LTOR_STRETCH	61	Stretch Left To Right

BBFX_RTOL_STRETCH	62	Stretch Right To Left

BBFX_CLOSE_STRETCH	63	Stretch while closing horizontal.

BBFX_OPEN_STRETCH	64	Stretch while opening horizontal.

BBFX_COPEN_STRETCH	65	Stretch vertically

BBFX_CCLOSE_STRETCH	66	Stretch while curtain close

BBFX_PALETTE_FADE	67	Fade into the image using the palette. Works best on 16 color images displayed in 256 color mode.

BBFX_PALETTE_FADE_C20	68	Palette Fade with clear. Use Foreground palette and fade all colors.

BBFX_PALETTE_FADE_C18	69	Palette Fade with clear. Use Foreground palette and fade all colors but Black and White.

BBFX_PALETTE_FADE_C0	70	Palette Fade with clear. Use Foreground palette and fade all but the 20 static colors.

BBFX_PALETTE_FADE_C20NP	71	Palette Fade with clear. Use Background palette and fade all colors.

BBFX_PALETTE_FADE_C18NP	72	Palette Fade with clear. Use Background palette and fade all but Black and White.

BBFX_PALETTE_FADE_C0NP	73	Palette Fade with clear. Use Background palette and fade all but the 20 static colors.

BBFX_TTOB_ROLL_IN	74	Roll image in from top to bottom

BBFX_BTOT_ROLL_IN	75	Roll image in from bottom to top

BBFX_LTOR_ROLL_IN	76	Roll image in from left to right

BBFX_RTOL_ROLL_IN	77	Roll image in from right to left

BBFX_TTOB_ROLL	78	Roll canvas away from top to bottom

BBFX_BTOT_ROLL	79	Roll canvas away from bottom to top

BBFX_LTOR_ROLL	80	Roll canvas away from left to right

BBFX_RTOL_ROLL	81	Roll canvas away from right to left

BBFX_GROW_CIRCLES	82	Growing circles from center

BBFX_GROW_STARS	83	Growing stars from center

BBFX_RAINDROPS	84	Raindrops in a pool of water

BBFX_STARDROPS	85	Growing random stars like raindrops

BBFX_OCTDROPS	86	Growing random octagons like raindrops

BBFX_DIAMONDDROPS	87	Growing random diamonds like raindrops

BBFX_STAR4DROPS	88	Growing random 4 pt stars like raindrops

BBFX_XDROPS	89	Growing random x's like raindrops

BBFX_MOVEAWAY_R	90	Move the canvas right leaving the image

BBFX_MOVEAWAY_RD	91	Move the canvas right/down leaving the image

BBFX_MOVEAWAY_D	92	Move the canvas down leaving the image

BBFX_MOVEAWAY_DL	93	Move the canvas down/left leaving the image

BBFX_MOVEAWAY_L	94	Move the canvas left leaving the image

BBFX_MOVEAWAY_LU	95	Move the canvas left/up leaving the image

BBFX_MOVEAWAY_U	96	Move the canvas up leaving the image

BBFX_MOVEAWAY_UR	97	Move the canvas up/right leaving the image

BBFX_MOVEAWAY_SPIRAL	98	Move the canvas spiral clockwise leaving the image

BBFX_MOVEAWAY_CSPIRAL	99	Move the canvas spiral counter clockwise leaving the image

BBFX_TTOB_LINES	100	Growing lines from top to bottom

BBFX_BTOT_LINES	101	Growing lines from bottom to top

BBFX_LTOR_LINES	102	Growing lines from left to right

BBFX_RTOL_LINES	103	Growing lines from right to left

BBFX_STRETCH_RD	104	Stretch going right and down

BBFX_STRETCH_LD	105	Stretch going left and down

BBFX_STRETCH_LU	106	Stretch going left and up

BBFX_STRETCH_RU	107	Stretch going right and up


Distributing the DLL's

There are two license agreements available for Visual FX. The "Application License" allows you to distribute the DLL files along with your program as long as you are not selling your program. The "Reseller License" allows you to distribute the DLL files along with the programs you are selling.


BitBltFX

BOOL FAR PASCAL

BitBltFX(DestDC, x, y, nWidth, nHeight, SrcDC, xSrc, ySrc, Rop,

FX, Grain, SubGrain, Delay, StopKey, UseTransp, TColor, hTable);

HDC DestDC;	/* handle of destination device context	*/

int x;	/* upper-left corner destination rectangle	*/

int y;	/* upper-left corner destination rectangle	*/

int nWidth;	/* bitmap width	*/

int nHeight;	/* bitmap height	*/

HDC SrcDC;	/* handle of source device context	*/

int xSrc;	/* upper-left corner source bitmap	*/

int ySrc;	/* upper-left corner source bitmap	*/

long Rop;	/* raster operation for copy	*/

int FX;	/* special effect to use	*/

int Grain;	/* major effect grain	*/

int SubGrain;	/* minor effect grain	*/

int Delay;	/* effect delay	*/

WPARAM StopKey;	/* key to stop effect	*/

BOOL UseTransp;	/* use transparent color	*/

COLORREF TColor;	/* transparent color	*/

HGLOBAL hTable;	/* handle to movement table	*/

The BitBltFX function copies a bitmap from a specified device context to a destination device context using a special effect and optional movement.

Parameter	Description

DestDC	Identifies the destination device context.

x	Specifies the logical x-coordinate of the upper-left corner of the destination rectangle.

y	Specifies the logical y-coordinate of the upper-left corner of the destination rectangle.

nWidth	Specifies the width, in logical units, of the destination rectangle and source bitmap.

nHeight	Specifies the height, in logical units, of the destination rectangle and source bitmap.

SrcDC	Identifies the device context from which the bitmap will be copied. This parameter must be NULL if the dwRop parameter specifies a raster operation that does not include a source. This parameter can specify a memory device context.

xSrc	Specifies the logical x-coordinate of the upper-left corner of the source bitmap.

ySrc	Specifies the logical y-coordinate of the upper-left corner of the source bitmap.

Rop	Specifies the raster operation to be performed. Raster operation codes define how the graphics device interface (GDI) combines colors in output operations that involve a current brush, a possible source bitmap, and a destination bitmap.

FX	The special effect to use. This can be an integer ranging from 0 to BBFX_MAX_EFFECT. You should use the constants defined in the VISBBFX.H header file that start with BBFX_.

Grain	The grain while doing the effect. You can specify -1 and Visual FX will use a default recommended value.

SubGrain	The secondary grain for effects that require two grains. Some effects (Like the Blocks from top to bottom) use the Grain for the X size and SubGrain for the Y size. Other effects (Like Roll Canvas) use the Grain for the amount moved each location and the SubGrain for the size of the "Roll". You can specify -1 and Visual FX will use a default recommended value.

Delay	The millisecond delay time between each grain. You can specify -1 and Visual FX will use a default recommended value.

StopKey	The key to stop the effect. If you don't want to stop then use BBFX_NOKEY. Use BBFX_ANYKEY for any keyboard input, or BBFX_ANYINPUT for any keyboard or mouse input. If you want a specific key then use the VK_* constants defined in the windows.h file.

UseTransp	Set to true if you want to display the image using the transparent color.

TColor	Transparent color. Use the RGB or PALETTERGB macros to build the transparent color.

hTable	Handle to a global memory object that contains a Movement Table. This table sets up movement for the image after it is displayed. Movement works best for smaller images. Set this to NULL if you don't want any movement.

Returns

The return is the same as BitBlt. Returns non zero if the function is successful. Otherwise, it is zero. There are extended status codes returned with the BitBltFXStatus function.

Comments

Use the BitBltFX function in places you would normally use the BitBlt function to display bitmaps on the screen. It has the same functionality but with extended parameters for specifying the special effect options.

The speed of the effect is determined by several factors including the speed of the computer, the size of the image, the grains used and the delay factor.

Use the hTable handle to specify movement for the image once the image is displayed. This is a handle to a table that contains an array of coordinates and delays. Refer to Movement table for more information.

The sample program VisualFX.exe is a very good place to see the effects in action as well as a good place to see how the functions are implemented.

See Also

BitBltFXStatus, BitBltFXInfo,


BitBltFXStatus

int FAR PASCAL

  BitBltFXStatus(void);

The BitBltFXStatus returns the status of the most recent BitBltFX call.

Returns

The return value is one of the following:

BBFX_OK	Function was successful.

BBFX_ERROR	A windows error occurred.

BBFX_KEYHIT	The user interrupted the effect.

BBFX_OUTOFMEMORY	Failed due to lack of memory.

See Also

BitBltFX, BitBltFXInfo


BitBltFXInfo

void FAR PASCAL

  BitBltFXInfo(int FX, int nWidth, int nHeight, LPFXINFO Info);

int FX;	/* which effect to inquire about	*/

int nWidth;	/* Width of image you are displaying	*/

int nHeight;	/* Height of image you are display	*/

LPFXINFO Info;	/* Pointer to return structure	*/

This function returns in the Info structure the recommended Grain, SubGrain and Delay for the specified effect. It uses the nWidth and nHeight parameters to determine the best values given the size of the image. You can also pass a -1 for the Grain, SubGrain, and Delay parameters to have BitBltFX determine the recommended value.

See the LPFXINFO data type for more information.

Returns

The Info structure contains the Grain, SubGrain, and Delay that is recommended for the specified effect and size.

Parameter	Description

FX	Identifies the effect.

nWidth	Specifies the width of the image you are going to display.

nHeight	Specifies the height of the image you are going to display.

Info	The data structure that returns the recommended Grain, SubGrain & delay.

See Also

BitBltFX


ShowWMFFX

int FAR PASCAL

ShowWMFFX(MfName, DestDC, x, y, nWidth, nHeight,

FX, Grain, SubGrain, Delay, StopKey, UseTransp, TColor, hTable);

LPSTR MFName;	/* pointer to filename string	*/

HDC DestDC;	/* handle of destination device context	*/

int x;	/* upper-left corner destination rectangle	*/

int y;	/* upper-left corner destination rectangle	*/

int nWidth;	/* displayed width	*/

int nHeight;	/* displayed height	*/

int FX;	/* special effect to use	*/

int Grain;	/* major effect grain	*/

int SubGrain;	/* minor effect grain	*/

int Delay;	/* effect delay	*/

WPARAM StopKey;	/* key to stop effect	*/

BOOL UseTransp;	/* use transparent color	*/

COLORREF TColor;	/* transparent color	*/

HGLOBAL hTable;	/* handle to movement table	*/

The ShowWMFFX function reads a WMF file from disk and displays it on a destination device context using a special effect and optional movement.

Parameter	Description

MFName	A pointer to the filename for the WMF file. If the directory is not specified then the current directory is used.

DestDC	Identifies the destination device context.

x	Specifies the logical x-coordinate of the upper-left corner of the destination rectangle.

y	Specifies the logical y-coordinate of the upper-left corner of the destination rectangle.

nWidth	Specifies the width, in logical units, of the destination rectangle.

nHeight	Specifies the height, in logical units, of the destination rectangle.

FX	The special effect to use. This can be an integer ranging from 0 to BBFX_MAX_EFFECT. You should use the constants defined in the VISBBFX.H header file that start with BBFX_.

Grain	The grain while doing the effect. You can specify -1 and Visual FX will use a default recommended value.

SubGrain	The secondary grain for effects that require two grains. Some effects (Like the Blocks from top to bottom) use the Grain for the X size and SubGrain for the Y size. Other effects (Like Roll Canvas) use the Grain for the amount moved each location and the SubGrain for the size of the "Roll". You can specify -1 and Visual FX will use a default recommended value.

Delay	The millisecond delay time between each grain. You can specify -1 and Visual FX will use a default recommended value.

StopKey	The key to stop the effect. If you don't want to stop then use BBFX_NOKEY. Use BBFX_ANYKEY for any keyboard input, or BBFX_ANYINPUT for any keyboard or mouse input. If you want a specific key then use the VK_* constants defined in the windows.h file.

UseTransp	Set to true if you want to display the image using the transparent color.

TColor	Transparent color. Use the RGB or PALETTERGB macros to build the transparent color.

hTable	Handle to a global memory object that contains a Movement Table. This table sets up movement for the image after it is displayed. Movement works best for smaller images. Set this to NULL if you don't want any movement.

Returns

The return value is zero if successful. Otherwise it is one of the VFX_* error codes.

Comments

The size of the displayed meta file is specified with the nWidth, and nHeight parameters.

See Also

BitBltFX, BitBltFXInfo, ShowDIBFX


ShowDIBFX

int FAR PASCAL

ShowDIBFX(fName, DestDC, PaletteOption, SizeOption, x, y, nWidth, nHeight,

FX, Grain, SubGrain, Delay, StopKey, UseTransp, TColor, hTable);

LPSTR fName;	/* pointer to filename string	*/

HDC DestDC;	/* handle of destination device context	*/

int PaletteOption;	/* how to treat the image palette	*/

int  SizeOption;	/* should image be stretched	*/

int x;	/* upper-left corner destination rectangle	*/

int y;	/* upper-left corner destination rectangle	*/

int nWidth;	/* bitmap width	*/

int nHeight;	/* bitmap height	*/

int FX;	/* special effect to use	*/

int Grain;	/* major effect grain	*/

int SubGrain;	/* minor effect grain	*/

int Delay;	/* effect delay	*/

WPARAM StopKey;	/* key to stop effect	*/

BOOL UseTransp;	/* use transparent color	*/

COLORREF TColor;	/* transparent color	*/

HGLOBAL hTable;	/* handle to movement table	*/

The ShowDIBFX function reads a DIB or BMP file from disk and displays it on a destination device context using a special effect and optional movement.

Parameter	Description

fName	A pointer to the filename for the DIB/BMP file. If the directory is not specified then the current directory is used.

PaletteOption	How should the palette be treated:

PALETTE_NEAR	Match the image palette to what is currently in use.

PALETTE_FILES	Use the palette saved in the image file.

PALETTE_UNIVERSAL	Use a Visual FX universal palette.

SizeOption	Show the image cropping or stretching:

SIZE_FILES	Crop the image to nWidth, nHeight

SIZE_FIT	Stretch/shrink image to nWidth, nHeight

DestDC	Identifies the destination device context.

x	Specifies the logical x-coordinate of the upper-left corner of the destination rectangle.

y	Specifies the logical y-coordinate of the upper-left corner of the destination rectangle.

nWidth	Specifies the width, in logical units, of the destination rectangle.

nHeight	Specifies the height, in logical units, of the destination rectangle.

FX	The special effect to use. This can be an integer ranging from 0 to BBFX_MAX_EFFECT. You should use the constants defined in the VISBBFX.H header file that start with BBFX_.

Grain	The grain while doing the effect. You can specify -1 and Visual FX will use a default recommended value.

SubGrain	The secondary grain for effects that require two grains. Some effects (Like the Blocks from top to bottom) use the Grain for the X size and SubGrain for the Y size. Other effects (Like Roll Canvas) use the Grain for the amount moved each location and the SubGrain for the size of the "Roll". You can specify -1 and Visual FX will use a default recommended value.

Delay	The millisecond delay time between each grain. You can specify -1 and Visual FX will use a default recommended value.

StopKey	The key to stop the effect. If you don't want to stop then use BBFX_NOKEY. Use BBFX_ANYKEY for any keyboard input, or BBFX_ANYINPUT for any keyboard or mouse input. If you want a specific key then use the VK_* constants defined in the windows.h file.

UseTransp	Set to true if you want to display the image using the transparent color.

TColor	Transparent color. Use the RGB or PALETTERGB macros to build the transparent color.

hTable	Handle to a global memory object that contains a Movement Table. This table sets up movement for the image after it is displayed. Movement works best for smaller images. Set this to NULL if you don't want any movement.

Returns

The return value is zero if successful. Otherwise it is one of the VFX_* error codes.

Comments

See the description for BitBltFX for the effect information.

See Also

BitBltFX, BitBltFXInfo, ShowWMFFX


TABLETYPE0

typedef struct tagTABLETYPE0 {

int	TableType;

HBITMAP	hSaveArea;

int	NumPts;

MOVETYPE	MoveData[1];

} TABLETYPE0;

The TABLETYPE0 structures defines the movement information for Visual FX.

Member	Description

TableType	Defines what type of table. Must be set to TABLE_MOVETYPE.

hSaveArea	Handle to a screen save area. If your program already has a buffer then you can use its buffer within BitBltFX to conserve memory. This can be set to NULL.

NumPts	How many points in the movement array.

MoveData	An array of MOVETYPE specifying the locations and delays for each new location.

See Also

BitBltFX, MOVETYPE


MOVESIZETYPE

typedef struct tagMOVESIZETYPE {

int	Delay;

int	X;

int	Y;

int	DX;

int	DY;

} MOVESIZETYPE;

The MOVESIZETYPE structure defines the Delay, X, Y, and size values for doing movement. Visual FX will stretch or shrink the image to fit within the specified width and height values.

Member	Description

Delay	The delay in milliseconds between each new location.

X	The x location to display the image.

Y	The y location to display the image.

DX	The width of the displayed image.

DY	The height of the displayed image.

See Also

BitBltFX, TABLESIZETYPE


MOVETYPE

typedef struct tagMOVETYPE {

int	Delay;

int	X;

int	Y;

} MOVETYPE;

The MOVETYPE structure defines the Delay, X, and Y values for doing movement.

Member	Description

Delay	The delay in milliseconds between each new location.

X	The x location to display the image.

Y	The y location to display the image.

See Also

BitBltFX, TABLETYPE0


MOVESIZESRCTYPE

typedef struct tagMOVESIZESRCTYPE {

int	Delay;

int	X;

int	Y;

int	DX;

int	DY;

int	SrcX;

int	SrcY;

int	SrcDX;

int	SrcDY;

} MOVESIZESRCTYPE;

The MOVESIZESRCTYPE structure defines the Delay, X, Y, and size of both the destination and source image values for doing movement. Visual FX will stretch or shrink the image to fit within the specified width and height values using the specified offset and size of the source image.

Member	Description

Delay	The delay in milliseconds between each new location.

X	The x location to display the image.

Y	The y location to display the image.

DX	The width of the displayed image.

DY	The height of the displayed image.

SrcX	The x offset within the source image.

SrcY	The y offset within the source image.

SrcDX	The width of the source image.

SrcDY	The height of the source image.

See Also

BitBltFX, TABLESIZESRCTYPE


BEZIERPTS

typedef struct tagBEZIERPTS {

int	Delay;

int	Style;

int	Spacing;

POINT	pts[4];

int	StartDX;

int	StartDY;

int	StartSrcX;

int	StartSrcY;

int	StartSrcDX;

int	StartSrcDY

int	EndDX;

int	EndDY;

int	EndSrcX;

int	EndSrcY;

int	EndSrcDX;

int	EndSrcDY;

} BEZIERPTS;

The BEZIERPTS structure defines the Delay, spacing, coordinates and sizes for movement along a bezier or spline curve. Values are specified for both the displayed image and source image sizes at both the beginning and ending of the movement. Visual FX will stretch or shrink the image to fit within the specified width and height values using the specified offset and size of the source image. Intermediate location sizes are automatically determined based upon the beginning and ending size values.

Member	Description

Delay	The delay in milliseconds between each new location.

Style	What type of bezier points:

BEZIER_NORMALPTS Normal control points.

BEZIER_LINEPTS Modified points where all 4 control points are on the curve.

Spacing	The number of points between each new displayed location.

pts[4]	An array of x,y values defining the 4 spline control points.

pts[0].x,pts[0].y The first control point.

pts[1].x,pts[1].y The second control point.

pts[2].x,pts[2].y The third control point.

pts[3].x,pts[3].y The forth control point.

StartDX	The width of the displayed image at the start of the movement.

StartDY	The height of the displayed image at the start of the movement.

StartSrcX	The x offset of the source image at the start of the movement.

StartSrcY	The y offset of the source image at the start of the movement.

StartSrcDX	The width of the source image at the start of the movement.

StartSrcDY	The height of the source image at the start of the movement.

EndDX	The width of the displayed image at the end of the movement.

EndDY	The height of the displayed image at the end of the movement.

EndSrcX	The x offset of the source image at the end of the movement.

EndSrcY	The y offset of the source image at the end of the movement.

EndSrcDX	The width of the source image at the end of the movement.

EndSrcDY	The height of the source image at the end of the movement.

GetRectangle is very helpful for visually defining the widths and heights.

See Also

GetBezierCurve, BitBltFX, TABLEBEZIERTYPE


LPFXINFO

typedef struct tagFXINFO {

  int Grain;

  int SubGrain;

  int Delay;

  } FXINFO;

#define LPFXINFO FXINFO far *

The FXINFO structure defines the Grain, SubGrain and Delay for use with the BitBltFXInfo function..

Member	Description

Grain	The suggested Grain size.

SubGrain	The suggested SubGrain size.

Delay	The suggested Delay in milliseconds.

See Also

BitBltFX, BitBltFXInfo


MakeUnivPal256

HPALETTE FAR PASCAL

  MakeUnivPal256(void);

Returns

The return value is the handle to a palette if successful. Otherwise it returns NULL.

Comments

The palette is a fairly good way to display several images on the screen at the same time. If you use this palette for several images in a row, you won't see the palette shift when going from one image to another.

You must use the DeleteObject function to remove the palette from memory when done.


Visual Basic Information

The syntax for Visual Basic is quite different than for other languages such as C or Pascal. However, the functionality of the Visual FX DLLs are the same. The text file VFXBAS.TXT contains all of the Visual Basic constants, types and function declarations needed. We will try to point out the differences here.

Parameter Types

Here is a listing of the equivalent Visual Basic types compared to C data types:

C Data Type	Visual Basic Data Type

HDC	Integer

int	Integer

long	Long

WPARAM	Integer

BOOL	Integer (0 = False, Anything Else = True)

COLORREF	Long

HGLOBAL	Integer

LPSTR	String

To do movement within Visual FX, you must pass a handle to a global memory block. This is rather difficult (if not impossible) in Visual Basic. To help out, the VISLB1FX.DLL has 3 useful functions to create, set, and delete these tables.

CreateTable - Allocate the global memory block and initialize the table needed for Visual FX.

SetTableItem - Set an X Y position in the movement array. You need to call this repeatedly for every location you want the image to move to.

DestroyTable - Delete from memory the global memory block allocated with CreateTable.

Sample Code

Dim hTable As Integer

Dim r As Integer

'Create the table allowing room for 25 movement entries.

'TABLE_MOVETYPE is a Visual FX constant defining the type of movement table.

'0 is a handle to a savearea that is not used in Visual Basic.

'25 defines how many locations you want the image to move to.

hTable = CreateTable(TABLE_MOVETYPE, 0, 25)

'Set values in the table. For this example move the image from the upper left

'to the lower right moving 2 pixels at a time with 0 Millisecond delay between

movements.

For I = 0 To 24	'Note that the table starts at index 0 not at index 1.

SetTableItem hTable, I, I * 2, I * 2, 0

Next I

'Now call ShowDIBFX using the hTable parameter.

r = ShowDIBFX(Form1.Label1.Caption, SmallImage.hDC, PALETTE_FILES, SizeOption, SmallImage.ScaleLeft, SmallImage.ScaleTop, SmallImage.ScaleWidth / 2, SmallImage.ScaleHeight / 2, 0, 0, FX, -1, -1, -1, BBFX_ANYKEY, False, RGB(255, 255, 255), hTable)

'When done make sure to call DestroyTable to free the memory.

DestroyTable hTable

See Also

VK_* StopKey Constants, RGB, PALETTERGB


VK_* StopKey Constants

Windows defines constants for both the keyboard and for the mouse buttons. Here are the constants and their values for your reference to be used as the StopKey parameter for the Visual FX functions.

Constant	Value

VK_LBUTTON	Hex 01

VK_RBUTTON	Hex 02

VK_CANCEL	Hex 03

VK_MBUTTON	Hex 04

VK_BACK 	Hex 08

VK_TAB	Hex 09

VK_CLEAR	Hex 0C

VK_RETURN	Hex 0D

VK_SHIFT	Hex 10

VK_CONTROL	Hex 11

VK_MENU 	Hex 12

VK_PAUSE	Hex 13

VK_CAPITAL	Hex 14

VK_ESCAPE	Hex 1B

VK_SPACE	Hex 20

VK_PRIOR	Hex 21

VK_NEXT 	Hex 22

VK_END	Hex 23

VK_HOME 	Hex 24

VK_LEFT 	Hex 25

VK_UP	Hex 26

VK_RIGHT	Hex 27

VK_DOWN 	Hex 28

VK_SELECT	Hex 29

VK_PRINT	Hex 2A

VK_EXECUTE	Hex 2B

VK_SNAPSHOT	Hex 2C

VK_INSERT	Hex 2D

VK_DELETE	Hex 2E

VK_HELP 	Hex 2F

VK_NUMPAD0	Hex 60

VK_NUMPAD1	Hex 61

VK_NUMPAD2	Hex 62

VK_NUMPAD3	Hex 63

VK_NUMPAD4	Hex 64

VK_NUMPAD5	Hex 65

VK_NUMPAD6	Hex 66

VK_NUMPAD7	Hex 67

VK_NUMPAD8	Hex 68

VK_NUMPAD9	Hex 69

VK_MULTIPLY	Hex 6A

VK_ADD	Hex 6B

VK_SEPARATOR	Hex 6C

VK_SUBTRACT	Hex 6D

VK_DECIMAL	Hex 6E

VK_DIVIDE	Hex 6F

VK_F1	Hex 70

VK_F2	Hex 71

VK_F3	Hex 72

VK_F4	Hex 73

VK_F5	Hex 74

VK_F6	Hex 75

VK_F7	Hex 76

VK_F8	Hex 77

VK_F9	Hex 78

VK_F10	Hex 79

VK_F11	Hex 7A

VK_F12	Hex 7B

VK_F13	Hex 7C

VK_F14	Hex 7D

VK_F15	Hex 7E

VK_F16	Hex 7F

VK_F17	Hex 80

VK_F18	Hex 81

VK_F19	Hex 82

VK_F20	Hex 83

VK_F21	Hex 84

VK_F22	Hex 85

VK_F23	Hex 86

VK_F24	Hex 87

VK_NUMLOCK	Hex 90

VK_SCROLL	Hex 91

VK_A through VK_Z are the same as their ASCII equivalents: 'A' through 'Z' (Hex 41 through 5A).

VK_0 through VK_9 are the same as their ASCII equivalents: '0' through '9' (Hex 30 through 39).

See Also

BitBltFX, ShowWMFFX, ShowDIBFX


RGB & PALETTERGB

RGB(int red, int green, int blue)

PALETTERGB(int red, int green, int blue)

red	Integer in the range of 0 to 255, inclusive, that represents the red component of the color.

green	Integer in the range of 0 to 255, inclusive, that represents the green component of the color.

blue	Integer in the range of 0 to 255, inclusive, that represents the blue component of the color.

Returns a long integer representing an Red-Green-Blue color value. RGB will match the color to one of the 20 system colors. PALETTERGB will match any of the possible colors. It is usually easier to use the basic colors like Black or white because when working with palettes, the RGB value will be different if you are using the files palette, near palette, or universal palette.

Here are some of the most used color values:

Color	RGB value	Red value	Green value	Blue value

Black	Hex 00	0	0	0

Blue	Hex FF0000	0	0	255

Green	Hex FF00	0	255	0

Cyan	Hex FFFF00	0	255	255

Red	Hex FF	255	0	0

Magenta	Hex FF00FF	255	0	255

Yellow	Hex FFFF	255	255	0

White	Hex FFFFFF	255	255	255

Note: Visual Basic does not support the PALETTERGB function. However, you can achieve the same result by calling the RGB function then add Hex 2000000 to the result.


BitBltFXSetStyle

void FAR PASCAL BitBltFXSetStyle(int style, HWND hwnd);

int style;	/* Set the style of the Visual FX delay	*/

HWND hwnd;	/* Handle to the destination window	*/

The BitBltFXSetStyle function specifies how Visual FX delays while doing the effects. It allows you to specify if the function yields to other Windows messages or completes the effect completely without yielding.

Parameter	Description

style	How should the Visual FX delay:

BBFX_NOYIELD	Do not yield to messages, check for "StopKey". This is the default value if you do not call this function.

BBFX_YIELD	Yield and dispatch Window messages and check for "StopKey". If you use this option, the minimum delay is 1 Millisecond and thus the effects might be slower.

BBFX_NODELAY	Do not yield and do not check for "StopKey". This will achieve the fastest effects.

hwnd	The handle to the destination window. This is required if you are using the BBFX_YIELD option.

Returns

This function does not return a value.

Comments

You only need to call this procedure once. The hwnd parameter is only needed if you are using the BBFX_YIELD option. If you are using the BBFX_YIELD option and the ShowDIBFX function, then you can use the GetCurPal function to return the current palette when handling the WM_QUERYNEWPALETTE and WM_PALETTECHANGED messages. The BitBltFXStop procedure is also used to stop the current effect.

See Also

BitBltFX, BitBltFXInfo, ShowWMFFX


BitBltFXStop

void FAR PASCAL BitBltFXStop(void);

The BitBltFXStop function will stop the special effect.

Returns

This function does not return a value.

Comments

This function is used in conjunction with the BitBltFXSetStyle procedure when you set up Visual FX to yield while doing the effects. Sometimes it is wanted or necessary to stop the effect under program control such as when your program exits.

See Also

BitBltFX, BitBltFXInfo, ShowWMFFX


MakeNearPal

HPALETTE FAR PASCAL

  MakeNearPal(HPALETTE hPal, HPALETTE hLastPal);

HPALETTE hPal;	/* Handle to current image palette*/

HPALETTE hLastPal;	/* Handle to the last image palette*/

The MakeNearPal function creates a palette based on hPal but is close to or near the colors of hLastPal.

Parameter	Description

hPal	Handle to the palette of the image you are about to display.

hLastPal	Handle to the palette of the last image or to the palette that you want to use as the "base" palette. If this parameter is NULL then a near palette is created that is near to the current system palette.

Returns

The return value is the handle to a palette if successful. Otherwise it returns NULL.

Comments

The palette is a fairly good way to display several images on the screen at the same time. If you use this palette for several images in a row, you won't see the palette shift when going from one image to another.

The palette should be selected into the memory device context as well as the screen device context and realized before calling BitBltFX.

You must use the DeleteObject function to remove the palette from memory when done.


GetCurPal

HPALETTE FAR PASCAL

  GetCurPal(void);

The GetCurPal function returns the handle to the palette of the last image displayed with ShowDIBFX.

Returns

The return value is the handle to a palette if successful. Otherwise it returns NULL.

Comments

This palette handle is usually used when handling the WM_QUERYNEWPALETTE and WM_PALETTECHANGED messages. The VisualFX.cpp sample program uses this function.

You should use the DestroyCurPal function to remove the palette from memory before you exit your program.


DestroyCurPal

void FAR PASCAL

  DestroyCurPal(void);

The DestroyCurPal function removes the palette from memory that was used with the last image displayed with ShowDIBFX.

Returns

This function does not return a value.

Comments

This procedure is usually called before exiting your program or when you want to free up all available memory. You do not need to call this procedure before each call to ShowDIBFX.


CreateTable

UINT FAR PASCAL

  CreateTable(int TableType, HBITMAP hSaveArea, int NumPts);

INT TableType;	/* Constant to specify what type of table	*/

HBITMAP hSaveArea;	/* Handle to a savearea bitmap	*/

int NumPts;	/* How many points to allocate	*/

The CreateTable function creates a table in memory to use as the movement array.

Parameter	Description

TableType	A Visual FX constant describing the type of table.

TABLE_MOVETYPE Table contains x,y locations

TABLE_MOVESIZETYPE Table contains x,y and size values

TABLE_MOVESIZESRCTYPE Table contains location and size for output and sources

TABLE_MOVEBEZIERTYPE Table contains Bezier spline coordinates

hSaveArea	Handle to a savearea bitmap. If you already have a savearea bitmap then you can pass it to Visual FX to reduce memory and time. This can be NULL.

NumPts	The number of locations you want the image to move to.

Returns

The return value is the handle to the global memory block.

Comments

This function is very useful for Visual Basic. It allocates a memory block that is used for movement of the image. Use SetTableItem to set each new X Y location and to set the delay between each new location. Use DestroyTable to de-allocate the memory when finished.

See Also

BitBltFX, ShowDIBFX, ShowWMFFx, Visual Basic Info


SetTableItem

void FAR PASCAL

  SetTableItem(HGLOBAL hTable, int Item, int x, int y, int Delay);

HGLOBAL hTable;	/* Handle to the movement table	*/

int Item;	/* Index to the array of X Y's	*/

int x;	/* The x location of the new position	*/

int y;	/* The y location of the new position	*/

int Delay;	/* The millisecond delay before moving	*/

The SetTableItem function sets the x, y, and Delay for a movement location.

Parameter	Description

hTable	A handle to the movement table created with the CreateTable function.

Item	The index into the array to indicate which array items to set.

x	The x location of the upper left corner of the image.

y	The y location of the upper left corner of the image.

Delay	The delay in milliseconds to delay before moving.

Returns

The procedure does not return a value.

Comments

You must call this function for every location you specified when you created the table using CreateTable.

Note: The array is zero based. This means that if you want the image to move to 5 locations, then you would call this procedure with "Item" set from 0 to 4.

See Also

BitBltFX, ShowDIBFX, ShowWMFFx, Visual Basic Info


SetTableSizeItem

void FAR PASCAL

  SetTableSizeItem(HGLOBAL hTable, int Item, int x, int y, int dx, int dy, int Delay);

HGLOBAL hTable;	/* Handle to the movement table	*/

int Item;	/* Index to the array of X Y's	*/

int x;	/* The x location of the new position	*/

int y;	/* The y location of the new position	*/

int dx;	/* The width of the image	*/

int dy;	/* The height of the image	*/

int Delay;	/* The millisecond delay before moving	*/

The SetTableSizeItem function sets the x, y, width, height and Delay for a movement location. Visual FX will stretch or shrink the image to display it using the dx,dy parameters.

Parameter	Description

hTable	A handle to the movement table created with the CreateTable function.

Item	The index into the array to indicate which array items to set.

x	The x location of the upper left corner of the image.

y	The y location of the upper left corner of the image.

dx	The width of the displayed image.

dy	The height of the displayed image.

Delay	The delay in milliseconds to delay before moving.

Returns

The procedure does not return a value.

Comments

You must call this function for every location you specified when you created the table using CreateTable.

Note: The array is zero based. This means that if you want the image to move to 5 locations, then you would call this procedure with "Item" set from 0 to 4.

See Also

BitBltFX, ShowDIBFX, ShowWMFFx, Visual Basic Info


SetTableBezier

void FAR PASCAL

  SetTableBezier(HGLOBAL hTable, BEZIERPTS far *Bez);

HGLOBAL hTable;	/* Handle to the movement table	*/

BEZIERPTS far *Bez;	/* Pointer to a BEZIERPTS record	*/

The SetTableBezier function sets bezier curve information in a movement table.

Parameter	Description

hTable	A handle to the movement table created with the CreateTable function.

Bez	A pointer to a BEZIERPTS record.

Returns

The procedure does not return a value.

Comments

It is helpful to use GetBezierCurve to visually define a bezier curve using the mouse and keyboard.

See Also

BEZIERPTS, BitBltFX, ShowDIBFX, ShowWMFFx, Visual Basic Info


DestroyTable

void FAR PASCAL

  DestroyTable(UINT hTable);

UINT hTable;	/* Handle to the movement table	*/

The DestroyTable function de-allocates the movement table from memory.

Parameter	Description

hTable	A handle to the movement table created with the CreateTable function.

Returns

The procedure does not return a value.

Comments

You must call this function when you are done using the movement table.

See Also

BitBltFX, ShowDIBFX, ShowWMFFx, Visual Basic Info


Movement Tables

Movement is accomplished by defining a table that contains information about where the image should be moved to.

TABLETYPE0TABLESIZETYPE

TABLESIZESRCTYPE

TABLEBEZIERTYPE


TABLESIZETYPE

typedef struct tagTABLESIZETYPE {

int	TableType;

HBITMAP	hSaveArea;

int	NumPts;

struct tagMOVESIZETYPE	MoveData[1];

} TABLESIZETYPE;

The TABLESIZETYPE structures defines the movement and size information for Visual FX.

Member	Description

TableType	Defines what type of table. Must be set to TABLE_MOVESIZETYPE.

hSaveArea	Handle to a screen save area. If your program already has a buffer then you can use its buffer within BitBltFX to conserve memory. This can be set to NULL.

NumPts	How many points in the movement array.

MoveData	An array of MOVESIZETYPE specifying the locations and delays for each new location.

See Also

BitBltFX, MOVESIZETYPE


TABLESIZESRCTYPE

typedef struct tagTABLESIZESRCTYPE {

int	TableType;

HBITMAP	hSaveArea;

int	NumPts;

struct tagMOVESIZESRCTYPE	MoveData[1];

} TABLESIZESRCTYPE;

The TABLESIZESRCTYPE structures defines the movement and size information for Visual FX for both the output and source images.

Member	Description

TableType	Defines what type of table. Must be set to TABLE_MOVESIZESRCTYPE.

hSaveArea	Handle to a screen save area. If your program already has a buffer then you can use its buffer within BitBltFX to conserve memory. This can be set to NULL.

NumPts	How many points in the movement array.

MoveData	An array of MOVESIZESRCTYPE specifying the locations and delays for each new location.

See Also

BitBltFX, MOVESIZESRCTYPE


TABLEBEZIERTYPE

typedef struct tagTABLEBEZIERTYPE {

int	TableType;

HBITMAP	hSaveArea;

int	NumPts;

struct tagBEZIERPTS	MoveData;

} TABLEBEZIERTYPE;

The TABLEBEZIERTYPE structures defines a spline or bezier curve for movement and size information for Visual FX.

Member	Description

TableType	Defines what type of table. Must be set to TABLE_MOVEBEZIERTYPE.

hSaveArea	Handle to a screen save area. If your program already has a buffer then you can use its buffer within BitBltFX to conserve memory. This can be set to NULL.

NumPts	How many points in the movement array.

MoveData	An array of BEZIERPTS specifying the locations and delays for each new location.

See Also

GetBezierCurve, BitBltFX, BEZIERPTS


CONSTANTS

Here is a listing of the constants used by the Visual FX procedures:

Values returned from BitBltFXStatus:

BBFX_ERROR = 0	Error cause by the Windows BitBlt function

BBFX_OK = 1	OK

BBFX_KEYHIT = 2	Effect interrupted by a StopKey

BBFX_OUTOFMEMORY = 3	Could not do effect because out of memory

Values used in setting the delay method using BitBltFXSetStyle:

BBFX_NOYIELD = 0	Check for "StopKey" but do not yield to other applications. This is the default method.

BBFX_YIELD = 1	Check for "StopKey" and yield to other applications. This allows concurrent operation of the special effect and other programs.

BBFX_NODELAY = 2	Do not check for "StopKey" and do not do any delays and do not yield to other applications. This will result in the fastest effects.

Values used to define specific types of movement tables used with CreateTable:

TABLE_MOVETYPE = 0	Standard x,y locations.

TABLE_MOVESIZETYPE = 1	Sets x,y and width,heights of image.

TABLE_MOVESIZESRCTYPE = 2	Sets x,y and width,height for both the displayed image and the source image.

TABLE_MOVEBEZIERTYPE = 3	Sets the control points for a bezier spline. It also sets the starting and ending sizes of the displayed and source images.

Values to set the type of BEZIERPTS:

BEZIER_NORMALPTS = 0	The control points are the normal points for a bezier spline.

BEZIER_LINEPTS = 1	The control points use a modified bezier spline where all 4 control points are on the spline.

Values used as "StopKey" constants:

BBFX_NOKEY = 0x0000	Do not stop for any user input.

BBFX_ANYKEY = 0xFFFE	Stop for any key press.

BBFX_ANYINPUT = 0xFFFF	Stop for any key press or any mouse movement or click.

Values to set the PaletteOption in ShowDIBFX:

PALETTE_NEAR = 0	Use a palette that is close to the one currently in use.

PALETTE_FILES = 1	Use the palette from the file.

PALETTE_UNIVERSAL = 2	Use a universal palette.

Values to set the SizeOption in ShowDIBFX:

SIZE_CROP = 0	Crop the image to match the nWidth,nHeight parameters.

SIZE_FILES = 1	Display the image using its original size.

SIZE_FIT = 2	Stretch/shrink the image to match the nWidth,nHeight parameters.

Values returned from ShowDIBFX and ShowWMFFX:

VFX_OK = 0	OK.

VFX_FILENOTFOUND = 1	The file was not found.

VFX_READERROR = 2	An error occurred reading the file.

VFX_OUTOFMEMORY = 3	Could not do effect because out of memory

VFX_NOTWMF = 4	The file is not a Windows Meta File.

VFX_NOTBITMAP = 5	The file is not a supported DIB or BMP file.


GetBezierCurve

int FAR PASCAL

  GetBezierCurve(HWND hWnd, BEZIERPTS far *Bez);

HWND hWnd;	/* Handle to window to display bezier curve*/

BEZIERPTS far *Bez;	/* Pointer to a BEZIERPTS record	*/

The GetBezierCurve function allows the user to use the mouse to visually define a bezier curve.

Parameter	Description

hWnd	A handle to a window where you want the curve drawn.

Bez	A pointer to a BEZIERPTS record.

Returns

The function returns TRUE when the user accepts the new coordinates or FALSE when the user does not want to use the new coordinates.

Comments

A bezier curve is drawn in the window with 4 control points. The user can use the mouse to drag the control points to new locations. To accept the new coordinates the user should double click with the left mouse button or press ENTER. To return without accepting the new coordinates, the user should double click with the right mouse button or press ESC.

The control point with the largest square is the beginning or start of the curve.

Before calling this procedure, you must initialize the "Style" to either BEZIER_NORMALPTS or BEZIER_LINEPTS. You must also initialize the "pts" array. For example:

BEZIERPTS Bez;

Bez.Style = BEZIER_LINEPTS;

Bez.pts[0].x = 0;

Bez.pts[0].y = 0;

Bez.pts[1].x = 10;

Bez.pts[1].y = 10;

Bez.pts[2].x = 20;

Bez.pts[2].y = 20;

Bez.pts[3].x = 30;

Bez.pts[3].y = 30;

GetBezierCurve(hWnd, &Bez)

Type of curve with Style set to BEZIER_NORMALPTS:

Type of curve with Style set to BEZIER_LINEPTS:

See Also

BEZIERPTS, BitBltFX, ShowDIBFX, ShowWMFFx, Visual Basic Info


GetRectangle

int FAR PASCAL

  GetRectangle(HWND hWnd, RECT far *Rect, BOOL SizeOnly);

HWND hWnd;	/* Handle to window to display rectangle	*/

RECT far *Rect;	/* Pointer to a RECT record	*/

BOOL SizeOnly;	/* Allow size and position to change	*/

The GetRectangle function allows the user to use the mouse to visually define the size and/or position of a rectangle.

Parameter	Description

hWnd	A handle to a window where you want the rectangle drawn.

RECT	A pointer to a RECT record.

SizeOnly	If TRUE then only allow the size of the rectangle to change. If FALSE then allow both the size and position of the rectangle to change..

Returns

The function returns TRUE when the user accepts the new coordinates or FALSE when the user does not want to use the new coordinates.

Comments

A rectangle is drawn in the window with control points on each corner and side. The user can use the mouse to drag the control points to new locations. To accept the new coordinates the user should double click with the left mouse button or press ENTER. To return without accepting the new coordinates, the user should double click with the right mouse button or press ESC.

Before calling this procedure, you must initialize the RECT record with valid entries.

For Example:

RECT Rect;

Rect.left = 0;

Rect.top = 0;

Rect.right = 100;

Rect.bottom = 100;

GetRectangle(hWnd, &Rect);

Rectangle with SizeOnly set to FALSE:

Rectangle with SizeOnly set to TRUE:

See Also

BEZIERPTS, BitBltFX, ShowDIBFX, ShowWMFFx, Visual Basic Info


RECT

typedef struct tagRECT {

  int left;

  int top;

  int right;

  int bottom;

  } RECT;

The RECT structure defines the position and size of a rectangle.

Member	Description

left	The left side or starting x coordinate of the rectangle.

top	The top or starting y coordinate of the rectangle.

right	The right side or ending x coordinate of the rectangle.

bottom	The bottom or ending y coordinate of the rectangle.

See Also

GetRectangle